import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
// 配置axios
import api from './http/api.js'
import '@/http/axios.js';

Vue.prototype.$api = api;
Vue.config.productionTip = false




// Vue.directive("auth", {
//   inserted: (el) => {
//     // 判断用户权限
//     if (store.state.userInfo.auth != 1) {
//       // el.parentElement.removeChild(el);
//       el.setAttribute('disabled', true);
//       // 添加禁用样式
//       el.classList.add('is-disabled');
//     }
//   }
// })

new Vue({
  router,
  store,
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this; //安装全局事件总线，$bus就是当前应用的vm
  }
}).$mount('#app')
